package com.lbh.graphics;

import com.jogamp.opengl.GL2;

/***
 * project:JRuntime
 * package:com.lbh.graphics
 *
 * @author user:lenovo QQ:1601078366
 * @date 2021/10/22 2:54
 * @version V1.0
 */
public class GLVertexBuffer {

    int buffer;
    int vertexArray;

    public GLVertexBuffer(GL2 gl){
        int[] tmp = new int[1];
        gl.glGenVertexArrays(1, tmp, 0);
        vertexArray = tmp[0];
        gl.glGenBuffers(1, tmp, 0);
        buffer = tmp[0];
        gl.glBindVertexArray(vertexArray);
        gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, buffer);
        gl.glBindVertexArray(0);
    }
}
